1) Field of the Invention
This invention relates to a method of preparing a structured document such as, for example, an SGML (Standard Generalized Markup Language) document in accordance with a predetermined document type definition and a computer-readable recording medium on which a structured document is recorded.
2) Description of the Related Art
Generally, an SGML (Standard Generalized Markup Language) document which employs a text format to represent, as document contents, document data except layout information and some other information is known as a structured document.
The SGML document can define a logical structure of the document by applying a symbol (mark) called tag for identification of the structure of the document and is being spreading as a document of a standard language for storage/retrieval or exchange of a document.
The SGML document includes an SGML declaration which describes various references such as a type of a character code used in the document, a DTD (Document Type Definition) which defines a mutual relationship between document elements, that is, a document structure, and a document instance which indicates contents of the document.
The DTD defines tags to be applied to elements (index, body, list and so forth) of the document and particularly includes element declarations which define elements of the document, relations of inclusion between the elements, an order in which the elements are arranged, the numbers of times of appearance of the elements and so forth, attribute declarations which define attributes of the elements, entity declarations which declare methods of taking special characters, pictures and so forth into the document, and other necessary declarations. The DTD can define memberships, an order of appearance, the numbers of times of appearance and so forth of the gaps in the form of a tree structure.
In order to prepare an SGML document, a document structure for the SGML, that is, a DTD, is produced or acquired first, and then a document instance which conforms with the DTD is produced.
Where the preparation of an SGML document involves preparations of different SGML documents having different logical structures from each other, a DTD suitable for a logical structure is produced or acquired for each of the logical structures.
Here, examples of description of DTDs (element declarations) for a table form layout and a hierarchical structure form layout as examples of a logical structure are described with reference to FIGS. 6 and 7. FIG. 6 shows an example of description of an element declaration of a DTD which defines a logical structure of the table form layout, and FIG. 7 shows an example of description of a factor declaration of a DTD which defines a logical structure of the hierarchical structure form layout.
An SGML document of the table form layout defined by such a DTD as shown in FIG. 6 is suitable for preparation and display of a table and is suitably applied, for example, to display a table as a template upon inputting of an SGML document so that a composer may describe contents in cells in accordance with the template and display the table on a display unit or print the table.
Meanwhile, an SGML document of the hierarchical structure form layout defined by such a DTD as shown in FIG. 7 is suitably applied, for example, to register the prepared document into an SGML database and retrieve desired information from within the database.
The DTD which defines a logical structure of the table form layout and the DTD which defines a logical structure of the hierarchical structure form layout have different structures from each other as seen from FIGS. 6 and 7, and a composer prepares an SGML document using a DTD which defines a logical structure suitable for an application of the SGML document. In short, the composer produces or acquires a DTD corresponding to the type of the logical structure and prepares an SGML document based on the DTD.
In such a structured document preparation method as described above, however, if it is tried to use a document to a different application as an SGML document, then a DTD which defines a logical structure suitable for the application must be produced or acquired and then an SGML document must be prepared using the DTD. Therefore, the structured document preparation method has a subject to be solved in that the operation mentioned is cumbersome and imposes a heavy burden to the composer.
For example, in order to display or print contents of a document as a table and besides register them into a database for later utilization, a DTD which defines a logical structure of the table form layout and another DTD which defines a logical structure of the hierarchical structure form layout must be produced and besides, for each of the types of the logical structures, an SGML document having a DTD corresponding to the type of the logical structure must be prepared. In short, a number of SGML documents whose document contents are identical but whose DTDs are different from each other equal to the number of types of logical structures (here, two) must be prepared.
Further, while an SGML document prepared is used, it sometimes becomes necessary to edit the DTD of the SGML document such as to newly add a document element (tag) in order to augment the convenience of use of the SGML document. However, when a document element (tag) is to be newly added to a plurality of SGML documents prepared individually with different logical structures or in a like case, the DTDs of the SGML documents must be edited (addition of the new element) without a miss in order to unify the contents of the SGML documents for the object of management of the SGML documents. However, when the DTDs of the SGML documents are edited as described above, the composer of the SGML documents must take care so that no miss may occur in the editing. Therefore, the structured document preparation method has another subject to be solved in that the management imposes a heavy burden on the composer.